package com.baor.vip.service.impl;

import com.baor.vip.domain.BrokerChangeDTO;
import com.baor.vip.domain.RechargeVO;
import com.baor.vip.mapper.RechargeMapper;
import com.baor.vip.service.RechargeService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.baor.common.utils.PageUtils.startPage;

@Service
public class RechargeServiceImpl implements RechargeService {
    @Autowired
    private RechargeMapper rechargeMapper;

    @Override
    public Map<String, Object> orderList(RechargeVO rechargeVO) {
        List<String> totalList = rechargeMapper.selectTotal();
        startPage();
        List<RechargeVO> orderList = rechargeMapper.orderList(rechargeVO);
        PageInfo<RechargeVO> pageInfo = new PageInfo<>(orderList);
        //
        Map<String,Object> map = new HashMap<>();
        map.put("totalList",totalList);
        map.put("orderList",pageInfo);
        return map;
    }

    @Override
    public List<String> originBox() {
        return rechargeMapper.originBox();
    }
}
